package com.fitness.front.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fitness.front.modal.course.entity.Course;
import com.fitness.front.modal.course.params.CoursePageQueryParams;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface CourseMapper extends BaseMapper<Course> {
    @Select("<script>select * from t_course c "
            + " <where>"
            + "<if test='queryParams.keywords != null and queryParams.keywords.trim() neq \"\"'>"
            + " AND c.name like  CONCAT('%',#{queryParams.keywords},'%')"
            + "</if>"
            + "</where>"
            +"</script>")
    Page<Course> getCoursePage(Page<Course> page, @Param("queryParams") CoursePageQueryParams queryParams);


}
